package com.ctgu.fcftsystem.service;

import com.ctgu.fcftsystem.dao.IncomeDao;
import com.ctgu.fcftsystem.pojo.Income;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class IncomeServiceImpl implements IncomeService{

    @Autowired(required=false)
    private IncomeDao incomeDao;

    @Override
    public List<Income> findByPaging(int pageCount, int pageSize) {
        return incomeDao.findByPaging(pageCount, pageSize);
    }

    @Override
    public int addIncome(Income income) {

        return incomeDao.addIncome(income);
    }

    @Override
    public List<Income> getIncomeList() {
        return incomeDao.getIncomeList();
    }

    @Override
    public int delIncomeById(int iid) {
        return incomeDao.delIncomeById(iid);
    }

    @Override
    public int updateIncome(Income income) {
        return incomeDao.updateIncome(income);
    }

    @Override
    public List<Income> searchIncome(Income income) {
        return incomeDao.searchIncome(income);
    }
}
